-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add type annotations to cairo_renderer.py
#4393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type annotations to cairo_renderer.py
#4393
Conversation
| self.static_mobjects: list[Mobject] = [] | ||
| self.time_progression: tqdm[float] | None = None | ||
| self.duration: float | None = None | ||
| self.duration: float = 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell setting self.duration = 0.0, will not cause any problems, but it avoids having to deal with it being None when calculating number of static frames or self.time.
| Iterable[Mobject] | ||
| The static image computed. | ||
| """ | ||
| self.static_image = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other methods and variables self.static_image should ideally be renamed to self.static_frame, but that can be done in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the type annotations, especially those for manim.utils.hashing! That's a pretty difficult module to type properly.
I left some change requests:
Co-authored-by: Francisco Manríquez Novoa <[email protected]>
Co-authored-by: Francisco Manríquez Novoa <[email protected]>
Co-authored-by: Francisco Manríquez Novoa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay.
LGTM! Thanks for your contribution!
Overview: What does this pull request change?
More work towards completing #3375.
Motivation and Explanation: Why and how do your changes improve the library?
This PR includes some type annotations to
utils/hashing.pyto complete typing forcairo_renderer.py. Typing forutils/hashing.pyshould be completed in another PR.Reviewer Checklist